home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / LIB / CHECKBOX.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.6 KB  |  90 lines

  1. package sub_arctic.lib;
  2.  
  3. import sub_arctic.input.*;
  4. import sub_arctic.output.*;
  5.  
  6. /**
  7.  * This is a version of a toggle which implements the look of a checkbox
  8.  * via the style system.
  9.  * 
  10.  * @author Ian Smith
  11.  */
  12. public class checkbox extends toggle {
  13.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  14.  
  15.   /**
  16.    * Make a checkbox in the current style.
  17.    * 
  18.    * @param int x the x position of this interactor
  19.    * @param int y the y position of this interactor
  20.    * @param callback_object co the object to send the callbacks to.
  21.    */
  22.   public checkbox(int x, int y, callback_object co) {
  23.     // default to the artkit look temporarily
  24.     super(x,y,co);
  25.  
  26.     /* set the style stuff going */
  27.     style_changed();
  28.   }
  29.  
  30.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  31.  
  32.   /**
  33.    * Make a checkbox in the current style with some defaults. We
  34.    * assume you are going to use constraints or direct setting to
  35.    * position this object.
  36.    * 
  37.    * @param callback_object co the object to send the callbacks to.
  38.    */
  39.   public checkbox(callback_object co) {
  40.     // default to the artkit look temporarily
  41.     super(0,0,co);
  42.  
  43.     /* set the style stuff going */
  44.     style_changed();
  45.   }
  46.  
  47.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  48.  
  49.   /**
  50.    * The style has changed, regenerate.
  51.    */
  52.   public void style_changed() {
  53.     loaded_image img[];
  54.  
  55.     img=style_manager.current_style().radio_button_make_images();
  56.  
  57.     /* set the images into the slots of the multibutton */
  58.     set_state_look(0,img[0]);
  59.     set_state_look(1,img[1]);
  60.  
  61.     /* now see if they have transitions */
  62.     img=style_manager.current_style().radio_button_make_transitions();
  63.  
  64.     /* if null, we are done */
  65.     if (img==null) return;
  66.  
  67.     /* they want transitions */
  68.     set_transition_look(0,img[0]);
  69.     set_transition_look(1,img[1]);
  70.   }
  71.  
  72.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  73. }
  74. /*=========================== COPYRIGHT NOTICE ===========================
  75.  
  76. This file is part of the subArctic user interface toolkit.
  77.  
  78. Copyright (c) 1996 Scott Hudson and Ian Smith
  79. All rights reserved.
  80.  
  81. The subArctic system is freely available for most uses under the terms
  82. and conditions described in 
  83.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  84. and appearing in full in the lib/interactor.java source file.
  85.  
  86. The current release and additional information about this software can be 
  87. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  88.  
  89. ========================================================================*/
  90.